1. Field of the Invention
The present invention pertains to a method and apparatus for using a list box to display sorted records, and particularly to a system in which the records are sorted by a column other than the first column of the record.
2. Description of the Related Art
As the use of graphic user interfaces increases, a number of standard graphic user interface programming tools have been created which simplify the development of new software application programs which operate under the graphic user interface. The graphic user interface programming tools automatically perform pre-designated functions for the programmer and automatically present and/or receive data to the end user with a pre-designated visual appearance. The programming tools thereby avoid the need for each programmer to re-program standard functions, and further avoid the need for each programmer to become concerned about how to display and/or input user data. Examples of such graphic user interface programming tools include simple tools which automatically display data in a variety of selectable formats; input tools which automatically display data with user-selectable push buttons, scroll bars, etc. which allow the end user to select a displayed data item; and complex tools which automatically manipulate data for the programmer, display the data, and allow user selection and/or modification of the displayed data. Standard programming tools are described in "Programmer's Reference, Vol. II: Functions", MICROSOFT WINDOWS.TM. Software Developer's Kit, Version 3.1 (MICROSOFT Part No. PC28916-0492) and "The Windows Interface: An Application Design Guide" (MICROSOFT Part No. PC28921-0692), the contents of which are incorporated herein by reference.
One kind of graphic user interface programming tool is known as a "list box". A list box automatically displays a list of records in a window and automatically allows an end user to scroll through the list and select one of the displayed records. A typical list box is shown in FIG. 12. The list box 10 includes plural records 11 which are arranged in a list. Each record includes plural columns 12 such as computer file name 12a, computer file size 12b, date created 12c, and time created 12d. A scroll bar 14 to the right of the list box allows a user to scroll through the list thereby allowing the user to view portions of the list that are not currently displayed. The user may continue to scroll through the list until a desired record is targeted, for example, by highlighting, and then may select the targeted record for further processing, for example, by pressing an enter key or by clicking on the targeted record with a mouse.
List boxes are powerful graphic user interface programming tools because they can be configured (or created) such that they insert records into the list in three different ways. First, the list box can be created such that it simply appends new records to the end of the existing list. In this configuration, the list box displays unsorted or randomly ordered records. Second, the list box can be created such that it allows the programmer to specify the location in the list where new records are to be inserted. In this configuration, the list box automatically bumps succeeding records which are already stored in the list so that the new record can be inserted into the list without losing data. Third, the list box can be created such that it automatically sorts records as it inserts new records. In this configuration, after the list box sorts each new record into the list, the list box returns the location at which the new record was inserted.
In the sort configuration, however, the list box can only sort in ascending order based on the first column of the record. This is inconvenient when it is desired to sort records based on columns other than the first, such as the second or successive columns. In this case, the graphic user interface programmer can no longer rely on a standard list box. Rather, the programmer must re-program his own sorting function, together with provisions for proper display and end user manipulation of displayed data, which distracts the programmer from the main programming task at hand. The re-coding task becomes more complicated when it is considered that the code may be ported into a foreign language which may include non-standard characters and corresponding non-standard sort sequences.